﻿@using Microsoft.AspNetCore.Identity
@using ZeroFramework.IdentityServer.API.IdentityStores

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

@if (SignInManager.IsSignedIn(User))
{
    <form asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="form-inline text-right">
        <ul class="navbar-nav mr-auto navbar-right">
            <li class="nav-item">
                <a asp-controller="Home" asp-action="Index" class="btn btn-link nav-link">@UserManager.GetUserName(User)</a>
            </li>
            <li class="nav-item">
                <button type="submit" class="btn btn-link nav-link">Log off</button>
            </li>
        </ul>
    </form>
}
else
{
    <ul class="navbar-nav">
        <li class="nav-item">
            <a asp-controller="Account" asp-action="Register" class="nav-link">Register</a>
        </li>
        <li class="nav-item">
            <a asp-controller="Account" asp-action="Login" class="nav-link">Log in</a>
        </li>
    </ul>
}